<template>
  <div class="sys-dict-table">
    <el-table :data="data">
      <el-table-column
        label="序号"
        prop="rowNumber"
        align="center"
        width="60"
      />
      <el-table-column
        label="字典标签"
        prop="dictLabel"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="字典键值"
        prop="dictValue"
        align="center"
        :show-overflow-tooltip="true"
      />
      <el-table-column
        label="创建时间"
        prop="createTime"
        align="center"
        width="180"
      />
      <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            type="text"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['sys:dictData:update']"
          >
            修改
          </el-button>
          <el-button
            type="text"
            @click="handleDelete(scope.row)"
            v-hasPermi="['sys:dictData:delete']"
          >
            删除
          </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'SysDictDataTable',
  props: {
    data: { type: Array, default: () => [] }
  },
  methods: {
    handleUpdate(row) {
      this.$emit('row-update', row)
    },
    handleDelete(row) {
      this.$emit('row-delete', row)
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
